package org.jupiter.blog.service.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.jupiter.blog.api.domain.JupiterDictionary;

import java.util.List;

@Mapper
public interface JupiterDictionaryMapper {

    int insert(JupiterDictionary dictionary);

    JupiterDictionary selectByUuid(@Param("uuid") String uuid);

    List<JupiterDictionary> selectAll();

    int updateByUuidSelective(JupiterDictionary dictionary);

    int deleteByUuid(@Param("uuid") String uuid);

    List<JupiterDictionary> selectByPage(
            @Param("dictType") String dictType,
            @Param("dictKey") String dictKey,
            @Param("dictLabel") String dictLabel,
            @Param("offset") int offset,
            @Param("limit") int limit
    );

    long countByQuery(
            @Param("dictType") String dictType,
            @Param("dictKey") String dictKey,
            @Param("dictLabel") String dictLabel
    );

    List<JupiterDictionary> selectByDictType(@Param("dictType") String dictType);

    List<JupiterDictionary> selectByParentUuid(@Param("parentUuid") String parentUuid);

    JupiterDictionary selectByDictTypeAndKey(
            @Param("dictType") String dictType,
            @Param("dictKey") String dictKey
    );

    List<JupiterDictionary> selectActiveByDictType(@Param("dictType") String dictType);
}
